// Codeshare Code;
#include <bits/stdc++.h>
using namespace std;
char s[100];
int cnt;
int main(){
	int n;
  cin >> n;
  for(int i =1;i<=n;i++){
  		cin >> s;
      double a;
      int b;
      cin >> a >> b;
      if(  a >= 37.5 && b == 1){
      		cout << s << endl;
          cnt++;
        }
  }
  cout << cnt;
	return 0;
}
